<?php
/**
 * Created by PhpStorm.
 * User: zing
 * Date: 2018/5/4
 * Time: 14:40
 */

echo 0.00;

if (0.00 == 0.00) {
    echo "0.00 == 0.00" . PHP_EOL;
}
$f = round(1 / 3, 3);
echo $f . PHP_EOL;//0.333
echo ($f * 3) . PHP_EOL;//0.999
echo (round($f * 3, 3)) . PHP_EOL;//0.999
echo (round($f * 3, 2)) . PHP_EOL;//1

//向下取整
echo (floor($f * 3)) . PHP_EOL;//0
//向上取整
echo (ceil($f * 3)) . PHP_EOL; //1

//四舍五入
if (round($f * 3, 2) == round($f * 3, 1)) {
    echo 'round($f * 3, 2) == round($f * 3, 1)' . PHP_EOL;
}

echo (1 + 1.00).PHP_EOL;//2
echo (1 + 1.10).PHP_EOL;//2.1
echo (1 + 1.11).PHP_EOL;//2.11